#pragma once

enum service_type
{
	USER_CHANGE,
	ONCE
};

struct service_data
{
	TCHAR service_name[64];
	TCHAR bin_path[64];
	service_type type;
};

extern service_data g_service_data;

bool load_service_data();
bool save_service_data(const CString &server_name);
BOOL is_installed(const CString &service_name);
BOOL install(const CString &service_name, const CString &binPath, service_type type = USER_CHANGE);
BOOL uninstall(const CString &service_name);
BOOL launch_app_into_different_session(LPTSTR lpCmdLine);
DWORD find_session_pid(LPTSTR lpProcessName, DWORD dwSessionId);
void start_app();
void WINAPI service_ctrl(DWORD dwOpcode);
void WINAPI service_main();
void msg_box(CString Msg);

extern DWORD curr_session;
extern SERVICE_STATUS_HANDLE hServiceStatus;
extern SERVICE_STATUS status;

extern skyfire::sf_debug<> g_sd;